home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 21 / Cream of the Crop 21 (Terry Blount) (October 1996).iso / program / tspa3540.zip / TSUNTG.INT < prev    next >
Text File  |  1996-09-07  |  5KB  |  163 lines

  1. {$B-,D-,F-,I+,N-,R-,S+,V+}
  2.  
  3. (*
  4. Timo Salmi UNiT G
  5.  
  6. A Turbo Pascal unit of informative routines, Crt replacements, and
  7. redirection.
  8.  
  9. All rights reserved 26-Nov-89
  10. Updated 6-Dec-89, 20-Mar-90, 22-Jul-90, 1-Aug-90, 8-Aug-90, 27-Oct-91,
  11.         13-Jun-92, 19-Oct-92, 8-Nov-92, 26-Jul-93, 22-Jun-94, 16-Aug-94
  12.  
  13. This unit may be used and distributed freely for PRIVATE, NON-COMMERCIAL,
  14. NON-INSTITUTIONAL purposes, provided it is not changed in any way, and
  15. that a proper attribution is made. For ANY other usage, such as use in a
  16. business enterprise or at a university, contact the author for the terms
  17. of registration.
  18.  
  19. The units are under development. Comments and contacts are solicited. If
  20. you have any feedback about this unit, please do not hesitate to use
  21. electronic mail for communication.
  22.  
  23. The author shall not be liable to the user for any direct, indirect or
  24. consequential loss arising from the use of, or inability to use, any unit,
  25. program or file howsoever caused. No warranty is given that the units and
  26. programs will work under all circumstances.
  27.  
  28. Timo Salmi (email: ts@uwasa.fi WWW: http://uwasa.fi/~ts/)
  29. Professor of Accounting and Business Finance
  30. Faculty of Accounting & Industrial Management
  31. University of Vaasa
  32. P.O. BOX 700, FIN-65101 Vaasa, Finland
  33.  
  34. 16-Aug-94: Moved to the new TSUNTM
  35.  All the keyboard routines
  36.  
  37. 26-Jul-93: Moved to TSUNTBOT
  38.  WARMBOOT
  39.  COLDBOOT
  40.  
  41. 30-Jun-93: Added
  42.  ISRAMFN
  43.  
  44. 8-Nov-92: Added
  45.  ACTDRVFN
  46.  MEDIAFN
  47.  
  48. 19-Oct-92: Added
  49.  FLOPSTFN
  50.  ISUBSTFN
  51.  
  52. 13-Jun-92: Added
  53.  GETSCAN
  54.  GETESCAN
  55.  
  56. 27-Oct-91: Added
  57.  ISANSIFN
  58.  
  59. *)
  60.  
  61. unit TSUNTG;
  62.  
  63. (* ======================================================================= *)
  64.                           interface
  65. (* ======================================================================= *)
  66.  
  67. uses Dos
  68.      {$IFDEF VER40}
  69.      ,TSUNT45
  70.      {$ENDIF}
  71.      ;
  72.  
  73. (* =======================================================================
  74.                      Informative routines
  75.    ======================================================================= *)
  76.  
  77. (* Number of diskette drives on the system *)
  78. function DRIVESFN : byte;
  79.  
  80. (* The name of the first diskette drive on the system *)
  81. function FDRIVEFN : char;
  82.  
  83. (* Number of disk devices. Only for MsDos 3.+, else returns 0, harcoded *)
  84. function DSKCNTFN : byte;
  85.  
  86. (* Is a media present in the given drive. Argument '0' can be used to
  87.    denote the default drive *)
  88. function INDRIVFN (drive : char) : boolean;
  89.  
  90. (* Is a media a fixed disk. Takes the drive letter (case independent) as
  91.    the argument. Argument '0' can be used for the default drive *)
  92. function FIXEDFN (drive : char) : boolean;
  93.  
  94. (* Get the floppy disk status. Is the floppy present and formatted.
  95.    For the status values see TSUNTG.TST procedure TEST16, or
  96.    interrupt $13 function $01 in Ralf Brown's inter32a.zip *)
  97. function FLOPSTFN (drive : char) : integer;
  98.  
  99. (* Test whether a drive is a substituted drive, that is has been subjected
  100.    to the MsDos subst command.  Requires a minumum of MS-DOS 3.1 *)
  101. function ISUBSTFN (drive : char) : boolean;
  102.  
  103. (* What kind of a disk media is in a disk drive.
  104.    Takes the drive letter (case independent) as the argument.
  105.    Argument '0' can be used for the default drive.
  106.    For the returned values see TEST18 in TSUNTG.TST
  107. *)
  108. function MEDIAFN (drive : char) : byte;
  109.  
  110. (* Get the currently active floppy drive on one drive systems.
  111.    Returns the drive letter 'A' or 'B'.
  112.    For an error returns '0', for two drive systems returns '2'. *)
  113. function ACTDRVFN : char;
  114.  
  115. (* Is a drive a ram probable disk
  116.    Network drivers and other special circumstances may interfere *)
  117. function ISRAMFN (drive : char) : boolean;
  118.  
  119. (* Is a drive a CD-ROM with MSCDEX driver installed *)
  120. function CDROMFN (drive : char) : boolean;
  121.  
  122. (* Get CD-ROM driver MSCDEX.EXE version *)
  123. function MSCVERFN (drive : char) : word;
  124.  
  125. (* =======================================================================
  126.                Crt replacements and their derivates
  127.    ======================================================================= *)
  128.  
  129. (* Set a 25*80 text mode and clear screen, no Crt unit required *)
  130. procedure CLS;
  131.  
  132. (* Set a 25*40 text mode and clear screen, no Crt unit required *)
  133. procedure CLS40;
  134.  
  135. (* As Turbo Pascal GoToYX but does not require the Crt unit *)
  136. procedure GOATXY (x, y : integer);
  137.  
  138. (* As Turbo Pascal WhereX but does not require the Crt unit *)
  139. function WHEREXFN : byte;
  140.  
  141. (* As Turbo Pascal WhereY but does not require the Crt unit *)
  142. function WHEREYFN : byte;
  143.  
  144. (* Reverse the colors of an area.
  145.    This is slow. For fast screen routines see TSUNTA. *)
  146. procedure REVAREA (x1, y1, x2, y2 : integer);
  147.  
  148. (* Returns whether ANSI.SYS or a similar screen driver has been loaded or not.
  149.    Use while in the text mode. Do not call not in the graphics modes.
  150.    Don't use the TP Crt unit in your program if you want ISANSIFN to work. *)
  151. function ISANSIFN : boolean;
  152.  
  153. (* =======================================================================
  154.                       Redirection
  155.    ======================================================================= *)
  156.  
  157. (* Direct write and writeln to printer *)
  158. procedure USEPRN;
  159.  
  160. (* Direct write and writeln to the screen *)
  161. procedure USECON;
  162.  
  163.